Skip to content

Conversation

@denischilik
Copy link
Contributor

@denischilik denischilik commented Nov 17, 2025

Background

Integration testing with WireMock requires manual validation of API interactions. Previously, after recording API requests, there was no automated way to verify that the SDK correctly replays against WireMock mappings. Additionally, user-friendly mapping edits (using ${json-unit.ignore} for dynamic fields) needed to be manually applied to WireMock JSON files, which was error-prone and time-consuming.

What Has Changed

Automated Verification Script

Added the run_clean_integration_tests.sh script that rebuilds the SDK as an xcframework and updates WireMock mappings.

Shared Utilities Refactor

Extracted shared logic into common.sh.

Improved WireMock Mappings

Replaced hardcoded API keys with regex patterns.

Checklist

  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have tested this locally.

Reference Issue (For employees only. Ignore if you are an outside contributor)

@denischilik denischilik requested a review from a team as a code owner November 17, 2025 17:39
@denischilik denischilik changed the title feat: Add automated verification script for WireMock integration tests feat: SDKE-529 Implement Verification Script Nov 17, 2025
@denischilik denischilik reopened this Nov 17, 2025
feat: add automated verification script for WireMock integration tests

Auto-applies user-friendly mappings and validates all API interactions.

refactor: extract common shell functions to common.sh

Removes code duplication between recording and verification scripts.

refactor: move wait_for_wiremock to common.sh

refactor: generalize start_wiremock with record/verify mode parameter

refactor: centralize WireMock configuration in common.sh

fix: use json-unit.ignore for dynamic fields in identify mapping

fix: simplify unused mappings check to avoid shell regex errors

remove keys
@denischilik denischilik force-pushed the feat/SDKE-529-Implement-Verification-Script branch from 07d2f22 to f7a70fd Compare November 17, 2025 17:47
@denischilik denischilik marked this pull request as draft November 17, 2025 17:56
- Add build_framework() function to common.sh to compile SDK as xcframework
- Update Project.swift to use local xcframework instead of Swift Package
- Update both run scripts to build framework before generating project
- Framework is built for iOS Simulator only for faster integration testing
- Stored in temp_artifacts/mParticle_Apple_SDK.xcframework
- Update README overview to explain xcframework compilation
- Add build steps to script descriptions
- Document temp_artifacts directory and build artifacts
- Add temp_artifacts/ and archives/ to .gitignore
- Clarify that SDK is rebuilt fresh on each test run
@denischilik
Copy link
Contributor Author

✨ Latest Changes: XCFramework Build System

Migrated from Swift Package dependency to xcframework-based build system for integration tests.

Key Changes

Build Process (commits 7936730 and ac8b48f):

  • ✅ Added build_framework() function in common.sh to compile SDK as xcframework
  • ✅ Updated Project.swift to use local xcframework instead of Swift Package
  • ✅ Both test scripts now build framework before running tests
  • ✅ Framework compiled for iOS Simulator only (faster builds)
  • ✅ Stored in temp_artifacts/mParticle_Apple_SDK.xcframework

Benefits:

  • 🚀 Consistent build artifacts across test runs
  • 🔄 Ensures tests always use latest code changes
  • 📦 Cleaner dependency management for integration tests
  • ⚡ Faster than full Swift Package resolution

Documentation:

  • Updated README with xcframework workflow
  • Documented temp_artifacts directory
  • Added build artifacts to .gitignore

This ensures the verification script has full control over the SDK build and can guarantee reproducible test environments.

@denischilik denischilik marked this pull request as ready for review November 17, 2025 19:30
@denischilik denischilik merged commit d5e25e0 into main Nov 18, 2025
9 of 11 checks passed
@denischilik denischilik deleted the feat/SDKE-529-Implement-Verification-Script branch November 18, 2025 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants